package com.wc.AlgoOJ._数学.CT0203;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/19 0:52
 * @description blg求阶乘
 * http://43.138.190.70:8888/p/CT0203
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextInt();
        long ans = 1;
        int mod = (int) 1e9 + 7;
        while (n > 0) {
            ans = ans * n % mod;
            n--;
        }
        System.out.println(ans);
    }
}
